#!/usr/bin/env bash
#judgement_wenshu
# 运行位置: youfeng@mongo3:/home/youfeng/mongo-dump

set -ex

dump_path=/mongodb/backup/
target_dump_path=/home/nfs/mongo-tmpdump-file

#chmod +x mongodump
##mkdir -p ${dump_path}
##./mongodump -h mongo6:40042 -d app_data -c judgement_wenshu  -u work -p haizhi -o ${dump_path}
##echo "dump数据完成.."
##
##./mongodump -h mongo6:40042 -d app_data -c enterprise_data_gov  -u work -p haizhi -o ${dump_path}
##echo "dump数据完成.."

echo "开始压缩..."

cd ${dump_path}app_data/
zip app_data.zip -r *
echo "数据压缩完成.."


sshpass -p youfeng243. scp app_data.zip youfeng@cs5:${target_dump_path}
echo "远程复制完成.."

rm -rf *
echo "删除文件完成.."
echo "完成dump"